<%--
  Created by IntelliJ IDEA.
  User: JMS
  Date: 2020/12/21
  Time: 16:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户登入页面</title>
    <meta charset="UTF-8">
    <meta name="author" content="forework">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-tap-highlight" content="no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <!-- bootstrap样式 -->
    <link rel="stylesheet" href="../../static/bootstrap/css/bootstrap.min.css">
    <script src="../../static/bootstrap/jquery-3.5.1.min.js"></script>
    <script src="../../static/bootstrap/js/bootstrap.min.js"></script>

    <!-- 其他样式 -->
    <link rel="stylesheet" type="text/css" href="../../static/css/less.css">
    <link rel="stylesheet" type="text/css" href="../../static/css/basic.css">

    <!-- 找回密码弹窗 -->
    <!-- <script type="text/javascript" scr="popup.js"></script> -->

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body class="wrapper">
<div align="center">
    <div class="" style="background-color: white;">
        <div class="login-top">
            <div style="height: 70px;background-color: white;">
                <div style="float: left;">
                    <img src="../../static/images/logo.png" width="150" height="75"/><img
                        src="../../static/images/login.png"/>

                </div>

            </div>
            <div class="login-topBg">
                <div class="login-topBg1">
                    <form name="login" id="login" action="/adminLoginCheck" method="post">
                        <div class="login-topStyle">
                            <div class="login-topStyle3" id="loginStyle" style="margin-top: 75px;">
                                <div style="display: flex;">
                                    <a href="../../pages/admin/adminLogin.jsp">
                                        <h3>管理员登录</h3>
                                    </a>
                                    <h2>/</h2>
                                    <a href="../../pages/user/userLogin.jsp">
                                        <h3 style="color: #3598db;">住户登录</h3>
                                    </a>
                                </div>

                                <div class="error-information" style="display:none;">您输入的密码不正确，请重新输入</div>
                                <div class="ui-form-item loginUsername">
                                    <input type="text" name="username" id="txt_UserName" placeholder="管理员名">
                                </div>
                                <div class="ui-form-item loginPassword">
                                    <input name="password" type="password" id="pwd_UserPassword" placeholder="请输入密码">
                                </div>
                                <div class="ui-form-item">
                                    <input style="border: 1px solid #ffffff;padding: 8px 0px 8px 5px; width: 50%;float: left " type="text"
                                           id="j_captcha" placeholder="验证码">
                                </div>
                                <img style="width: 50%;height: 36px" alt="点击更换" title="点击更换" onclick="changeVerifyCode(this)" src="/Kaptcha"/>
                                <span class="error_xinxi" style="display:none;">您输入的密码不正确，请重新输入</span>
                                <input type="button"
                                       style="width:228px!important;font-size:14px;background-color:#3598db;color:#ffffff;padding:8px 0px;line-height:22px;text-align:center;margin:10px 0px 0px 0px;cursor:pointer;border-radius:5px;display:inline-block;border-width:0px;"
                                       value="立即登录" onClick="checkform()">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="loginCen" style="margin-top: 55px;">
            <div class="login-center">
                <div class="loginCenter-moudle">
                    <div class="loginCenter-moudleLeft" style="margin-right: 60px;"> &nbsp;</div>
                    <div class="loginCenter-moudleRight" style="  width: 1067px;">
                        <!--第一个-->
                        <a class="loginCenter-mStyle loginCenter-moudle1" id="moudleRemove"
                           style="margin-left: 50px; display:block;width: 250px;">
                            <span class="moudle-img"><img src="../../static/images/login_bg_01.png"></span>
                            <span class="moudle-text">
                  <span class="moudle-text1" style="font-family:'微软雅黑' ;">快速查询
                  </span>
                  <span class="moudle-text2" style="font-family:'微软雅黑'">Quick query</span>
                </span>
                        </a>
                        <!--第二个-->
                        <a class="loginCenter-mStyle loginCenter-moudle2" style=" display:block; width: 280px;"
                           id="moudleRemove2">
                            <span class="moudle-img"><img src="../../static/images/login_bg_02.png"></span>
                            <span class="moudle-text">
                  <span class="moudle-text1" style="font-family:'微软雅黑'">缴费通知
                  </span>
                  <span class="moudle-text2" style="font-family:'微软雅黑'">Payment notice</span>
                </span>
                        </a>
                        <!--第三个-->
                        <a class="loginCenter-mStyle loginCenter-moudle3" style=" display:block;" id="moudleRemove3">
                            <span class="moudle-img"><img src="../../static/images/login_bg_03.png"></span>
                            <span class="moudle-text">
                  <span class="moudle-text"> <span class="moudle-text1" style="font-family:'微软雅黑'">自定义收费公示
                    </span>
                    <span class="moudle-text2" style="font-family:'微软雅黑'">Custom charge announcement</span>
                  </span>
                </span>
                        </a>

                    </div>
                </div>
            </div>
        </div>
        <div class="footer"><span class="footerText">阿就这物业管理系统 Copyright2020-2022</span></div>
    </div>
</div>
</body>

<script>

    $(function () {
        $(".close").click(function () {
            $(this).alert("close");
        })
        $(".alert").on("close.bs.alert", function (e) {
            $("#Modal-test").modal();
        })
    })

    function changeVerifyCode(img) {
        img.src = "/Kaptcha?" + Math.floor(Math.random() * 100);
    }

    function checkform() {
        if ($("#txt_UserName").val() == "") {
            alert("用户名不能为空！");
            $("#txt_UserName").focus();
            return false;
        }
        if ($("#pwd_UserPassword").val() == "") {
            alert("密码不能为空！");
            $("#pwd_UserPassword").focus();
            return false;
        }
        var verifyCodeActual = $('#j_captcha').val();
        if (!verifyCodeActual) {
            alert('请输入验证码！');
            return;
        }
        $.ajax({
            url: '/index/Kaptcha',
            type: 'POST',
            data: JSON.stringify({"verifyCodeActual": verifyCodeActual}),
            contentType: 'application/json',
            processData: false,
            cache: false,
            success: function (data) {
                if (data.success) {
                    $("#login").submit();
                } else {
                    alert('ERROR！' + data.errMsg);
                }
                // 点击验证码图片的时候，注册码会改变
                $('#captcha_img').click();
            }
        });
    }
</script>

